<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>指令</title>
</head>
<body>
    <div id="app">
        <p v-if="show">显示这段文本</p>
        <!--语法糖写法，v-bind:可省略为: v-on:可省略为@-->
        <a :href="url">链接</a>
        <a :href="imgUrl"><img :src="imgUrl" v-if="show"  height="50px" width="50px"/></a>
        <button @click="handleClose">点击隐藏</button>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.min.js"></script>
    <script>
       var app = new Vue({
            el: '#app',
            data: {
                show: true,
                url: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=25668084,2889217189&fm=26&gp=0.jpg',
                imgUrl: "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3869515018,2735128030&fm=26&gp=0.jpg"
            },
           methods:{
                handleClose:function (){
                    this.show = !this.show;
                }
           }
        })
    </script>
</body>
</html>
